package application.view.viewComponent.mainNav 
{
	import application.model.VO.ModuleNavItemVO;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.text.TextFormat;
	import ginger.ui.simple.SimpleBrightnessButton;
	import ginger.ui.simple.SimpleLabel;
	/**
	 * ...
	 * @author Ning
	 */
	public class NavListItem extends SimpleBrightnessButton
	{
		private var _simLabel:SimpleLabel;
		private var _data:ModuleNavItemVO;
		public function get moduleName():String {
			return _data.name;
		}
		public function NavListItem(data:ModuleNavItemVO) 
		{
			_data = data;
			var ui:DisplayObject;
			if (data.buttonUIKey != null && data.buttonUIKey != '') {
				var bmpData:BitmapData = AppGlobal.RESOURES_POOL.getObject(data.buttonUIKey) as BitmapData;
				if (bmpData)
				    ui = new Bitmap(bmpData);
			}
			else {
				_simLabel = new SimpleLabel();
				_simLabel.defaultTextFormat = new TextFormat('宋体', 12, 0);
				_simLabel.text = _data.name;
				ui = _simLabel as DisplayObject;
			}
			super(ui);
		}
	}
}